#include "config.h"

static const std::string SIP_DOMAIN = "211.100.17.183";
static const std::string SIP_PROXY = "211.100.17.183";
static const std::string SIP_REGISTAR = "211.100.17.183";
static const std::string SIP_STUN_SERVER = "";
static const int SIP_STUN_PORT = 0;
static const int SIP_PORT = 5060;
static const int RTP_PORT = 4000;

// For TCP trans
static const std::string P2P_SERVER = "";
static const int P2P_SERVER_PORT = 0;

// Service config

static const std::string SERVICE_CONFIG_FILE = "service/config/myservice.xml";

Config *Config::m_config;

Config::Config()
{
    init();
}

void Config::init()
{
    setSIPDomain(SIP_DOMAIN);
    setSIPProxy(SIP_PROXY);
    setSIPRegistar(SIP_REGISTAR);
    setStunServer(SIP_STUN_SERVER);
    setStunPort(SIP_STUN_PORT);
    setSIPPort(SIP_PORT);
    setRtpPort(RTP_PORT);
    setP2PServer(P2P_SERVER);
    setP2PPort(P2P_SERVER_PORT);
    setServiceConfigFile(SERVICE_CONFIG_FILE);
}

void Config::setSIPDomain(const std::string domain)
{
    m_sipDomain = domain;
}
void Config::setSIPProxy(const std::string proxy)
{
    m_sipProxy = proxy;
}

void Config::setSIPRegistar(const std::string registar)
{
    m_sipRegistar = registar;
}

void Config::setSIPPort(int port)
{
    m_sipPort = port;
}

void Config::setRtpPort(int port)
{
    m_rtpPort = port;
}

void Config::setP2PServer(const std::string server)
{
    m_p2pServer = server;
}

void Config::setP2PPort(const int port)
{
    m_p2pPort = port;
}

void Config::setStunServer(const std::string server)
{
    m_stunServer = server;
}

void Config::setStunPort(int port)
{
    m_stunPort = port;
}

void Config::setServiceConfigFile(const std::string filename)
{
    m_serviceConfigFile = filename;
}
